<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style"/>
	<meta content="telephone=no" name="format-detection"/>
<title>邀请好友</title>
<script type="text/javascript">
	(function() {
		var el = document.createElement("STYLE");
		var docEl = document.documentElement;
		var portrait = ((Math.min(docEl.clientWidth, docEl.clientHeight) / 320) * 10);
		var landscape = ((Math.max(docEl.clientWidth, docEl.clientHeight) / 568) * 17.75);
		el.innerHTML = "@media screen and (orientation:portrait) { html { font-size: " + portrait + "px!important; } }\n@media screen and (orientation:landscape) { html { font-size: " + landscape + "px!important; } }";
		docEl.firstElementChild.appendChild(el);
	})();
</script>
<link href="<%=path%>/css/stlye.css" rel="stylesheet" type="text/css"/>
</head>
<body style="background-color:#06c1ae; text-align:center;">

<div class="eject" style="display: none;">
	<div class="fenxiang"></div>
</div>
<div class="tu"><img src="<%=path%>/images/yaoq.jpg" width="100%" height="" /></div>
<div class="yaoqing">
   <p><a href="javascript:void(0);"  id="share-imme"> 邀请好友</a></p>
</div>

<div class="guiz">
   <p>邀请规则：</p>
   <p>邀请好友关注我们的微信，邀请每一个好友,您和您的好友都能获得一个兑换码。<br/>兑换码可以用来兑换平台上的任一商品。</p>
<p>注：好友关注后，兑换码自动赠送。可在“我的兑换码”中查看。</p>
</div>
<script src="<%=path%>/js/zepto.js"></script>
<script src="<%=path%>/js/jweixin-1.0.0.js"></script>
<script>
    $(function () {
    	$("#share-imme").tap(function(){
            $(".eject").show();
        });
        $(".eject").tap(function(){
            $(".eject").hide();
        });
    });
    
	wx.config({
	    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
	    appId: '${appId}', // 必填，公众号的唯一标识
	    timestamp: '${timestamp}', // 必填，生成签名的时间戳
	    nonceStr: '${nonceStr}', // 必填，生成签名的随机串
	    signature: '${signature}',// 必填，签名
	    jsApiList: [
	        'checkJsApi',
	        'onMenuShareTimeline',
	        'onMenuShareAppMessage',
	        'onMenuShareQQ',
	        'onMenuShareWeibo',
	        'hideMenuItems',
	        'showMenuItems',
	        'hideAllNonBaseMenuItem',
	        'showAllNonBaseMenuItem',
	        'translateVoice',
	        'startRecord',
	        'stopRecord',
	        'onRecordEnd',
	        'playVoice',
	        'pauseVoice',
	        'stopVoice',
	        'uploadVoice',
	        'downloadVoice',
	        'chooseImage',
	        'previewImage',
	        'uploadImage',
	        'downloadImage',
	        'getNetworkType',
	        'openLocation',
	        'getLocation',
	        'hideOptionMenu',
	        'showOptionMenu',
	        'closeWindow',
	        'scanQRCode',
	        'chooseWXPay',
	        'openProductSpecificView',
	        'addCard',
	        'chooseCard',
	        'openCard'
	      ]
		});
		
	function doShare(){
		var shareData = {
		   title: '${shareTitle}',
		   desc: '${shareContent_friends}',
		   link: '${shareLink}',
		  imgUrl: '${shareImg}',
		  success:function(){
		  },
		  fail: function () {
		  },
		  cancel: function () {
		  }
		};
		var shareData2 = {
		   title: '${shareContent}',
		   desc: '${shareContent}',
		   link: '${shareLink}',
		  imgUrl: '${shareImg}',
		  success:function(){
		  },
		  fail: function () {
		 },
		 cancel: function () {
		 }
		};
		wx.onMenuShareAppMessage(shareData);//“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
		wx.onMenuShareTimeline(shareData2);//“分享到朋友圈”
	}
	wx.ready(function () {
		//批量隐藏菜单
		wx.hideMenuItems({
		     menuList: [
		       'menuItem:readMode', // 阅读模式
		       'menuItem:openWithQQBrowser', // 在QQ浏览器中打开
		       'menuItem:openWithSafari', // 在Safari中打开
		       'menuItem:share:qq', // 分享到QQ
		       'menuItem:share:weiboApp', // 分享到Weibo
		       'menuItem:share:facebook', // 分享到FB
		       'menuItem:share:QZone', // 分享到 QQ 空间/menuItem:share:QZone 
		       'menuItem:share:email', //  邮件: "menuItem:share:email" 
		       'menuItem:copyUrl' // 复制链接
		     ],
		     success: function (res) {
		       
		     },
		     fail: function (res) {
		       
		     }
		   });
		doShare();
	});
</script>
<jsp:include page="/views/html5/commons/footer.jsp"></jsp:include>
</body>
</html>